using System;
using System.Collections.Generic;
using System.Text;
using DTO;
using DAO;

namespace BUS
{
    public class CT_HoaDonBUS
    {
        public void ThemCTHoaDon(int MaHD, int MaP, Double DonGia, DateTime NgayThanhToan, DateTime NgayBD)
        {
            try
            {
                CT_HoaDonDAO cthdDAO = new CT_HoaDonDAO();
                cthdDAO.ThemCTHoaDon(MaHD, MaP, DonGia, NgayThanhToan, NgayBD);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public Double LayTongTienTheoMaHD(int MaHD)
        {
            Double TongTien = 0;
            try
            {
                CT_HoaDonDAO cthdDAO = new CT_HoaDonDAO();
                TongTien = cthdDAO.LayTongTienTheoMaHD(MaHD);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return TongTien;
        }
    }
}
